home *** CD-ROM | disk | FTP | other *** search
/ SunSoft Catalyst CDWARE 1996 May to August / Catalyst CDWARE 1996 May to August.iso / .products / .bin / httpd / Solaris_2 / pure-moreinfo-mailer.pl < prev    next >
Perl Script  |  1995-09-26  |  4KB  |  102 lines

  1. #!/opt/internet/bin/perl -- -*-perl-*-
  2.  
  3. # ------------------------------------------------------------
  4.  
  5. # Form-mail.pl, by Reuven M. Lerner (reuven@the-tech.mit.edu).
  6. # This is a rewrite of a program that was trashed by our power
  7. # surge in the middle of February 1994.
  8.  
  9. # ------------------------------------------------------------
  10.  
  11. # Bugs and other fixes
  12.  
  13. # March 1, 1994 (Reuven)
  14. # Fixed security hole that could result from people
  15. # executing subshells
  16. # January 5, 1995 (McGredy)
  17. # Modified for Pure Software, Inc.
  18. # ------------------------------------------------------------
  19.  
  20. # Define fairly-constants
  21. $mailprog = '/usr/ucb/mail -s "PS Web Eval Form"';
  22. # Ric: Change this to "support@pure.com" when it goes to Test
  23. # Ric: Change this to "ricm@rahul.net" when installed on rahul or mnl
  24.  
  25. $recipient = 'ricm@rahul.net, info-home@pure.com';
  26.  
  27. # Print out what we need
  28. print "Content-type: text/html\n\n";
  29. print "<img src=/pure/logo.gif>";
  30. print "<p><hr><p>";
  31. print "<Head><Title>Thank You</Title></Head>";
  32. print "<Body><H1>Thank you for your request.</H1>";
  33.  
  34. # Get the input
  35. read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
  36.  
  37. # Split the name-value pairs
  38. @pairs = split(/&/, $buffer);
  39.  
  40. foreach $pair (@pairs)
  41. {
  42.     ($name, $value) = split(/=/, $pair);
  43.     $value =~ tr/+/ /;
  44.     $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  45.  
  46.     # Stop people from using subshells to execute commands
  47.     $value =~ s/~!/ ~!/g;
  48.  
  49.     # Uncomment for debugging purposes
  50.     # print "Setting $name to $value<P>";
  51.  
  52.     $FORM{$name} = $value;
  53. }
  54.  
  55. # Now send mail to $recipient
  56.  
  57. open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n";
  58. print MAIL "Pure Software Web Page Evaluation Sftware Request:\n";
  59. print MAIL "--------------------------------------------------\n\n";
  60. print MAIL "Name:      $FORM{'From'}\n";
  61. print MAIL "Title:     $FORM{'Title'}\n";
  62. print MAIL "Company:   $FORM{'Compny'}\n";
  63. print MAIL "Street:    $FORM{'Street'}\n";
  64. print MAIL "Street2:   $FORM{'Street2'}\n";
  65. print MAIL "City:      $FORM{'City'}\n";
  66. print MAIL "State:     $FORM{'State'}\n"; 
  67. print MAIL "Zip:       $FORM{'Zip'}\n";
  68. print MAIL "Country:   $FORM{'Country'}\n";
  69. print MAIL "EMail:     $FORM{'Reply-To'}\n";
  70. print MAIL "Phone:     $FORM{'Phone'}\n";
  71. print MAIL "Fax:       $FORM{'Fax'}\n";
  72. print MAIL "Does your organization sell software? $FORM{'ISV'}\n";
  73. print MAIL "Is your organization involved with in-house software development? $FORM{'MIS'}\n";
  74. print MAIL "Are you part of a systems integration team? $FORM{'sysint'}\n";
  75. print MAIL "Other Organization Type: $FORM{'otherorg'}\n";
  76. print MAIL "Development Environment:\n";
  77. print MAIL "    C: $FORM{'C'} C++: $FORM{'C++'} X: $FORM{'X'} Windows: $FORM{'Win'}\n";
  78. print MAIL "    Other Development Environment(s): $FORM{'otherdev'}\n";
  79. print MAIL "Hardware Environment:\n";
  80. print MAIL "    Sun: $FORM{'Sun'} HP: $FORM{'HP'} SGI: $FORM{'SGI'}\n";
  81. print MAIL "    Other: $FORM{'otherhdwe'}\n";
  82. print MAIL "Type of application(s) you are working on:\n";
  83. print MAIL "    $FORM{'appsworking'}\n";
  84. print MAIL "Number of Developers on team:    $FORM{'numdevteam'}\n";
  85. print MAIL "Number of Developers in company: $FORM{'numdevcmpy'}\n";
  86. print MAIL "Please send me the following FREE evaluation software:\n";
  87. print MAIL "    Purify: $FORM{'SendPYeval'} Quantify: $FORM{'SendQYeval'} PureLink: $FORM{'sendPLeval'} PureCoverage: $FORM{'sendPCeval'}\n";
  88. print MAIL "Please send me more information regarding:\n";
  89. print MAIL "    Purify'd Partners Program: $FORM{'partners'} Pure Software Inc: $FORM{'sendPSinfo'}\n";
  90. print MAIL "    Other (please Specify): $FORM{'otherinfo'}\n";
  91. print MAIL "Remote host: $ENV{'REMOTE_HOST'}\n";
  92. print MAIL "Remote IP address: $ENV{'REMOTE_ADDR'}\n";
  93. close (MAIL);
  94.  
  95.  
  96. print "<P>";
  97. print "<ul><li>Return to the <A HREF=\"/pure/index.html\">Pure Software Inc. Home 
  98. Page
  99.  </A>, if you want.</ul><P><hr>";
  100. print "<p>Your request has been forwarded to Pure Software Inc.";
  101.  
  102.